{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
 <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
                    <div class="box-header with-border">
						{%foreach from=$appoint_lists key=key item=value%}
							<a href="index.php?a=message.studentlist&class_id={%$value.class_id%}&message_type={%$message_type%}"{%if $value.class_id==$class_id%} class="btn btn-primary" {%else%} class="btn btn-default"{%/if%}>{%$value.class_name%}{%$show_name%}</a>
						{%/foreach%}  
					</div>    
                   <div class="box-body">
                        <table class="table table-bordered table-striped" id="mytable">
                                <thead>
                                    <tr style="background-color:#a273ff;">
                                        <td>学号</td>
                                        <td>姓名</td>
										<td>{%$show_content%}</td>
										<td width="130">操作</td>
                                    </tr>
                                </thead>
                                <tbody>
								{%foreach from=$divide_lists key=key item=value%}
                                    <tr>
									    <td>{%$value.student_no%}</td>
                                        <td>{%$value.student_name%}</td>
										<td>{%$value.message_content%}</td>
										<td>
                                        	 <a onClick="show('{%$value.student_no%}', '{%$value.student_name%}', '{%$value.student_id%}','{%$value.message_id%}','{%$value.message_content%}','{%$value.message_file%}')" href="#" class="btn btn-success btn-sm" data-toggle="modal" data-target="#myModal"  title="编辑"><i class="fa fa-edit"></i> </a>
                                             <a href="index.php?a=message.details&message_id={%$value.message_id%}&student_id={%$value.student_id%}&message_type={%$message_type%}" class="btn btn-warning btn-sm" title="查看"><i class="fa fa-search"></i></a>
                                        </td>
                                    </tr>	
                               {%/foreach%}     
                            </tbody>
                        </table>                     
				   </div><!--box-body -->
           </div><!--box box-default box-solid-->
        </section>             
        </div><!--row-->
    </section>
 </div>

<!--弹出框-->
<div class="modal fade" id="myModal" tabindex="-1"  aria-labelledby="myModalLabel">
  <div class="modal-dialog" >
    <div class="modal-content">
         <form name="myform" method="post" action="" enctype="multipart/form-data">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">{%if $message_type==1%}期末学生评语{%else%}学生日常记事{%/if%}</h4>
              </div>
              <div class="modal-body">
                    学号：<span id = "bbb"></span>  <span style="margin-left:20px;">姓名：</span><span id="ming"></span>
                    <div class="form-group" style="margin-top:16px;">
                        <p>{%if $message_type==1%}评语{%else%}记事{%/if%}内容:</p>
                        <textarea class="form-control" rows="3" name="message_content" id="fff"></textarea>
                    </div>
                    <div class="form-group" style="margin-top:16px;">

                        <p>附件：<span id="hhh"></span></p><input name="message_file" type="file">

                    </div>
              </div>
              <div class="modal-footer center-block">
			 
			    <input type="hidden" name="message_id" value="" id="ddd">
			    <input type="hidden" name="student_id" value="" id="ccc">
                <input type="submit" class="btn btn-primary" value="确定">
              </div>
          </form>
    </div>
  </div>
</div>
<!-- ./wrapper -->
{%include file="index.footer.tpl.php"%}
<script>

function show(a, b, c, d, f, h){
	
	$("#bbb").html(a);
	$("#ming").html(b);
	$("#ccc").val(c);
	$("#ddd").val(d);
	$("#fff").val(f);
	$("#hhh").html(h);
	}

</script>